package com.oxygen.design.state;

import com.oxygen.design.state.bean.Context;
import com.oxygen.design.state.interfaces.impl.StartState;
import com.oxygen.design.state.interfaces.impl.StopState;

/**
 * @author wangjie
 * @version V1.0
 * @title: StatePatternDemo
 * @description: TODO
 * @date 2022/3/12 10:57 PM
 **/
public class StatePatternDemo {

    public static void main(String[] args) {
        Context context = new Context();

        StartState startState = new StartState();
        startState.doAction(context);

        System.out.println(context.getState().toString());

        StopState stopState = new StopState();
        stopState.doAction(context);

        System.out.println(context.getState().toString());
    }

}
